<!doctype html>
<html>
	<head>
		<meta charset="utf-8">
		<title>Role PreEdit</title>
        <#include "../../inc/css.ftl">
		<link rel="stylesheet" href="${request.contextPath}/static/asset/jquery-ui/1.11.1/jquery-ui.min.css">

	</head>
	<body class="no-skin">
		<div class="container-fluid">
			<div class="row">
			  <div class="breadcrumbs">
				<ul class="breadcrumb">
					<li><i class="ace-icon fa fa-home home-icon"></i><a href="${request.contextPath}/index.jspx" target="_top">首页</a></li>
					<li><a href="">系统</a></li>
					<li><a href="list.jspx">角色信息</a></li>
					<li class="active">修改</li>
				</ul>
				  <!-- /.breadcrumb -->
			  </div>
			  <!-- /.breadcrumbs -->
			</div>
			<!-- /.row -->
			<div class="row">
				<div class="page-content">
					<div class="page-header">
						<h1>角色信息修改</h1>
					</div>
					<div class="row">
						<div class="col-xd-12">
						    <form action="edit.jspx" method="post" class="form-horizontal" role="form" id="form-data">
						    	<div class="form-group">
									<label class="col-sm-1 control-label no-padding-right"> 名称(<span class="red">*</span>)  </label>
									<div class="col-sm-2">
										<input type="hidden" id="id" name="id" value="${(role.id)!0}">
										<input type="text" id="name" name="name" placeholder="名称" value="${(role.name)!}" class="col-sm-12" />
									</div>
									<label class="col-sm-1 control-label no-padding-right"> 标识(<span class="red">*</span>)  </label>
									<div class="col-sm-2">
										<input type="text" id="identity" name="identity" placeholder="标识" value="${(role.identity)!}" class="from-control" />
									</div>
									
									<label class="col-sm-2 control-label no-padding-right">  首页地址(<span class="red">*</span>)  </label>
									<div class="col-sm-4">
										<input type="text" id="index" name="index" placeholder="首页地址" value="${(role.index)!}" class="col-sm-12" />
									</div>
								</div>
								<div class="form-group">
									<label class="col-sm-2 control-label no-padding-right"> 包含资源 (<span class="red">*</span>) </label>
									<div class="col-sm-8 role-resource ">
										<#list resources! as resource>
										<dl class="col-sm-6">
											<dt><label><input type="checkbox" id="resource_${(resource.id)!0}" name="resourceIds" value="${(resource.id)!0}"> ${(resource.name)!'未知'}</label>
<br/>（<#list permissions! as permission>
													<label><input type="checkbox" id="permission_${(resource.id)!0}_${(permission.id)!0}" name="permission_${(resource.id)!0}" value="${(permission.id)!0}"> ${(permission.name)!'未知'}</label>
												</#list>
                                                  ）											
</dt>
											<#list resource.subresources! as subresource>
                                            <dd><label><input type="checkbox" id="resource_${(subresource.id)!0}" name="resourceIds" value="${(subresource.id)!0}"> ${(subresource.name)!'未知'}</label>
<br/>（<#list permissions! as permission>
													<label><input type="checkbox" id="permission_${(subresource.id)!0}_${(permission.id)!0}" name="permission_${(subresource.id)!0}" value="${(permission.id)!0}"> ${(permission.name)!'未知'}</label>
												</#list>
</dd>
											</#list> 
										</dl>
										</#list>
									</div>
								</div>
								<div class="space-4"></div>

								<div class="form-group">
									<label class="col-sm-2 control-label no-padding-right">添加时间</label>
									<div class="col-sm-3">
										<input type="text" name="addtime" value="${(role.addtime)!.now}">
									</div>
                                    <label class="col-sm-2 control-label no-padding-right">修改时间</label>
									<div class="col-sm-3">
										<input type="text" name="edittime" value="${.now}">
									</div>
								</div>
								<div class="clearfix form-actions">
									<div class="col-sm-offset-2 col-sm-4">
										<button type="reset" class="btn">
											<i class="ace-icon fa fa-undo bigger-110"></i>
											重置
										</button>
										&nbsp;&nbsp;
										<button type="submit" class="btn btn-info">
											<i class="ace-icon fa fa-check bigger-110"></i>
											提交
										</button>
									</div>
								</div>
						    </form>
					    </div>
					</div>
					<!-- /.row -->
				</div>
				<!-- /.page-content -->
			</div>
		</div>
		<#include "../../inc/js.ftl">
		<script src="${request.contextPath}/static/asset/jquery-ui/1.11.1/jquery-ui.min.js"></script>
		<script src="${request.contextPath}/static/skin/default/js/manage-list.js"></script>
		<script>
			$(document).ready(function(){
				manage.Role.getPermission('${(role.id)!0}');
			});
		</script>
	</body>
</html>